1. Field
The exemplary embodiments described herein are generally directed to estimating sharpness, and more specifically, to estimating sharpness in document and scene images.
2. Related Art
With the proliferation of cameras on mobile devices, an ever-increasing number of photos are taken. Related art cameras capture a burst of images, in order to bracket camera settings or to capture an action shot. As the number of digital photos and the automatic processing of digital photos increases, there is a need for methods to assess the perceived blurriness of an image.
When photobooks are generated, image blurriness can be determined and the least blurry image can be selected from several similar images. Additionally, the size of the image in the photobook can be scaled so that the blurrier images are smaller. As mobile phones become more intertwined with other applications, there is a need for quickly assessing the blurriness of images, for focusing as well as for the other applications. Sharpness can be determined in computer vision tasks such as detecting shadows, which often have less sharp edges, and in identifying in-focus and out-of-focus areas of an image.
In the related art, cameras may capture document images on scenes. Taking photos of document pages as an alternative to scanning is becoming more feasible, as the resolution of mobile phones has improved. However, the estimating of sharpness/blurriness for photos of textual document pages is not adequately addressed by related art sharpness determination measures. From the user side, it may be difficult to determine whether a photo is well-focused on a mobile screen. Thus, there is an unmet need for a real-time method for estimating sharpness on a mobile phone.
When taking a photo, there may be different causes of blur. FIG. 1 illustrates blurring 101, 102 due to the motion of the camera relative to the object 100 being photographed. Here, object 100 is a document image. This blurring effect can be further accentuated when taking close-up photos, as shown in FIG. 2. The photo 200 is of a single page; the closer characters 201, 202 are less blurry than the far characters 203, 204.
Sharpness estimation is used in related art photo processing applications, such as selection, display, printing, restoration, and enhancement. Related art methods have been specifically proposed for estimating the sharpness/blurriness of a photo of a natural scene. However, photos of document pages have different characteristics than photos of natural scenes. Thus, the sharpness measures developed for natural scenes may not necessarily produce the same result for photos of document pages primarily composed of text.
Related art sharpness/blurriness measures require a “perfect” reference image for comparison. Such related art methods are used for evaluating the degradation of image quality due to various types of processing. Related art no-reference methods are for evaluating the sharpness of a photo for a single scene and across scenes without a reference image.
Related art no-reference methods are applied to all pixels in the image. No-reference methods are based on statistical characteristics of the pixel values in an image, including variance, autocorrelation, and kurtosis. Histograms of various measures may include histograms of grayscale levels, entropy of the gray levels, and Discrete Cosine Transform (DCT) coefficients in 8×8 blocks. Related art methods may also be based on the image power spectrum, band-pass filtering, and wavelets. One such related art method is the Gradient Method, which is based on relative grayscale values (the difference in grayscale values between two pixels). The Gradient Method computes the average of the gradient values over the entire image as a measure of sharpness. Various fixed offsets between pixels have also been proposed where the Gradient Method was used.
Other related art methods have focused on the edge pixels identified using an edge detector, such as the Canny edge detector. These edge-based approaches do not use a reference image. In these related art methods, the width of an edge is measured by counting the number of pixels with increasing grayscale values in one direction of the edge pixel, while counting the number of pixels with decreasing grayscale values in the other direction. The width is computed as the sum of both counts, excluding the edge pixel. Thus, the estimate of edge width is quantized to pixel widths (number of pixels). This is a relatively coarse estimate, especially in images with many high contrast and rapid transitions (such as text documents), where a transition often occurs in three pixels or less.
Another related art method is directed to edge pixels, and computes the standard deviation of the gradient magnitude profile of the edge to be combined as a weighted average with the magnitude of the edge.